#define _CRT_SECURE_NO_WARNINGS
#define _CRT_SECURE_NO_WARNINGS
#include"SLT.h"
void text1() {
	SListNode* pplist = NULL;
	SListPushBack(&pplist, 1);
	SListPushBack(&pplist, 2);
	SListPushBack(&pplist, 3);
	SListPrint(pplist);
	printf("\n");
}
void text2() {
	SListNode* pplist = NULL;
	SListPushfront(&pplist, 3);
	SListPushfront(&pplist, 2);
	SListPushfront(&pplist, 1);
	SListPrint(pplist);
	printf("\n");
}
void text3() {
	SListNode* pplist = NULL;
	SListPushfront(&pplist, 3);
	SListPushfront(&pplist, 2);
	SListPushfront(&pplist, 1);
	SListPrint(pplist);
	SListPopBack(&pplist);
	SListPopBack(&pplist);
	SListPopBack(&pplist);
	SListPopBack(&pplist);
	printf("\n");
}
void text4() {
	SListNode* pplist = NULL;
	SListPushBack(&pplist, 1);
	SListPushBack(&pplist, 2);
	SListPushBack(&pplist, 3);
	SListPrint(pplist);
	SListPopFront(&pplist);
	SListPopFront(&pplist);
	SListPopFront(&pplist);
	SListPopFront(&pplist);
}
void text5() {
	SListNode* pplist = NULL;
	SListNode* text = NULL;
	SListPushfront(&pplist, 3);
	SListPushfront(&pplist, 2);
	SListPushfront(&pplist, 1);
	if ((text=SListFind(pplist, 1) )!= NULL) {
		printf("%d", text->data);
	}
	printf("\n");
}

void text6() {
	SListNode* pplist = NULL;
	SListPushBack(&pplist, 1);
	SListPushBack(&pplist, 2);
	SListPushBack(&pplist, 3);
	SListNode* pos = NULL;
	pos = SListFind(pplist, 1);
	if (pos != NULL) {
		SLTInsert(&pplist, pos, 0);
	}
	SListPrint(pplist);
	printf("\n");
}
void text7() {
	SListNode* pplist = NULL;
	SListPushBack(&pplist, 1);
	SListPushBack(&pplist, 2);
	SListPushBack(&pplist, 3);
	SListNode* pos = NULL;
	pos = SListFind(pplist, 1);
	if (pos != NULL) {
		SLTInsert(&pplist, pos, 0);
	}
	SListPrint(pplist);
	SLTErase(&pplist, pos);
	SListPrint(pplist);
	printf("\n");
}
int main() {
	text1();
	text2();
	text3();
	text4();
	text5();
	text6();
	text7();
}